home *** CD-ROM | disk | FTP | other *** search
- function makeButtonShield()
- {
- var clp = this.createEmptyMovieClip("mc_button_shield",Tardis.depth++);
- var clpHA = clp.createEmptyMovieClip("mc_hitarea",Tardis.depth++);
- var w = 250;
- var h = 50;
- clpHA.moveTo(0,0);
- clpHA.beginFill(16711680);
- clpHA.lineTo(w,0);
- clpHA.lineTo(w,h);
- clpHA.lineTo(0,h);
- clpHA.lineTo(0,0);
- clpHA.endFill();
- clp._x = _xmouse - w / 2;
- clp._y = _ymouse - h / 2;
- clp.hitArea = clpHA;
- clp.onRollOut = function()
- {
- this.mc_hitarea.removeMovieClip();
- this.removeMovieClip();
- };
- clpHA._visible = false;
- }
- function splashRestart()
- {
- if(ActiveSection == null || overlay.active == true)
- {
- return undefined;
- }
- LastSection = ActiveSection;
- ActiveSection = null;
- bottomNav.show();
- bottomNav.clearActive();
- bottomNav.fadeOthers("","up");
- footer.sponsorButtonShow();
- if(ActiveItem != null)
- {
- LastItem = ActiveItem;
- itemExit();
- }
- else if(LastSection.type == "bespoke")
- {
- itemExit();
- }
- header.clearUp();
- }
- function webPageOpen(strURL)
- {
- if(PLAY_MODE == "browser")
- {
- getURL(strURL,"");
- }
- else if(ActiveSection.confirmweb != null)
- {
- lingo("Flsh_openWebPageConfirm(\"" + strURL + "\")");
- }
- else
- {
- lingo("Flsh_openWebPage(\"" + strURL + "\")");
- }
- }
- function sectionGo()
- {
- if(splash.blnAtStart == true)
- {
- delete splash.blnAtStart;
- header.go(ActiveSection.id);
- sectionLoad();
- }
- else
- {
- sectionLoad();
- }
- }
- function sectionLoad()
- {
- LastSection = null;
- var strID = ActiveSection.id;
- if(ActiveSection.type == "bespoke")
- {
- template.loadBespokeSection();
- UsageData.addPageEntry(ActiveSection.index);
- header.go(ActiveSection.id);
- }
- else
- {
- sideMenu.onComplete = function()
- {
- delete this.onComplete;
- template.loadModules();
- };
- template.onDataLoaded = function()
- {
- delete this.onDataLoaded;
- this.loadModules();
- };
- sideMenu.onReady = function()
- {
- this._visible = true;
- this.onReady = null;
- if(Shortcut != null)
- {
- header.go(ActiveSection.id);
- Tardis.ActiveItem = this.ItemHome.byPath(Shortcut);
- if(Tardis.ActiveItem == null)
- {
- Tardis.ActiveItem = this.ItemHome;
- }
- this.makeChildren(Tardis.ActiveItem);
- Tardis.itemLoad();
- delete Shortcut;
- }
- else if(Tardis.ActiveItem == null)
- {
- Tardis.ActiveItem = this.ItemHome;
- Tardis.itemLoad();
- }
- };
- sideMenu.make(strID);
- }
- if(ActiveSection.hideSponsor == "true")
- {
- footer.sponsorButtonHide();
- }
- else
- {
- footer.sponsorButtonShow();
- }
- }
- function sectionExit()
- {
- ActiveItem = null;
- LastItem = null;
- sideMenu.clearUp();
- adverts.clearUp();
- if(Shortcut != null)
- {
- sectionLoad();
- }
- else if(ActiveSection != null)
- {
- sectionGo();
- }
- else
- {
- splash.show();
- splash.restart();
- }
- }
- function itemJump(nmSection, strPath)
- {
- splash.interrupted = false;
- var objSectionNew = Sections.item(nmSection);
- if(overlay.active == true)
- {
- template.onReady = function()
- {
- Tardis.overlay.close();
- this.onReady = null;
- };
- }
- if(objSectionNew != ActiveSection)
- {
- LastSection = ActiveSection;
- ActiveSection = objSectionNew;
- Shortcut = strPath;
- bottomNav.setActive(ActiveSection.id);
- if(LastSection == null)
- {
- sectionLoad();
- }
- else
- {
- itemExit();
- }
- }
- else
- {
- ActiveItem = sideMenu.ItemHome.byPath(strPath);
- sideMenu.makeChildren(ActiveItem);
- itemLoad();
- }
- }
- function itemGo(Item)
- {
- switch(Item.attributes.type)
- {
- case "html":
- if(Childlock.active == true)
- {
- return undefined;
- }
- var strURL = Item.attributes.local != "true" ? "" : "assets/html/";
- strURL += Item.attributes.file;
- webPageOpen(strURL);
- itemLog(Item);
- break;
- case "lock":
- if(Childlock.active != true)
- {
- Childlock.lockDialog();
- }
- else
- {
- Childlock.unlockDialog();
- }
- break;
- case "app":
- itemLog(Item);
- break;
- case "shortcut":
- itemJump(Item.attributes.section,Item.attributes.itemref);
- break;
- case "promo":
- overlay.showPromo(ASSETS_FOLDER + "promos/" + Item.attributes.file);
- break;
- default:
- break;
- case "template":
- case "bespoke":
- LastItem = ActiveItem;
- ActiveItem = Item;
- if(LastItem != null)
- {
- itemExit();
- }
- else
- {
- itemLoad();
- }
- return true;
- }
- }
- function itemLoad()
- {
- sideMenu.onComplete = function()
- {
- delete this.onComplete;
- template.loadModules();
- };
- template.onDataLoaded = function()
- {
- delete this.onDataLoaded;
- this.loadModules();
- };
- if(ActiveSection.hideSponsor != "true" || ActiveItem.attributes.hideSponsor == "false")
- {
- footer.sponsorButtonShow();
- }
- else
- {
- footer.sponsorButtonHide();
- }
- template.load();
- itemLog(ActiveItem);
- }
- function loadAdvertButton()
- {
- var item_advert = ActiveItem.attributes.advert;
- var advert_id = item_advert != null ? item_advert : ActiveSection.advert;
- if(advert_id != adverts.strPlaylistID)
- {
- adverts.prepare(advert_id);
- }
- }
- function itemExit()
- {
- template.exit();
- }
- function itemHide()
- {
- if(ActiveItem.attributes.type === "template")
- {
- template.hide();
- }
- }
- function itemShow()
- {
- if(ActiveItem.attributes.type === "template")
- {
- template.show();
- }
- }
- function itemLog(Item)
- {
- var str = ActiveSection.index;
- if(Item != sideMenu.ItemHome)
- {
- str += sideMenu.arrParentIndex.length <= 0 ? "" : "." + sideMenu.arrParentIndex.join(".");
- str += Item.firstChild.hasChildNodes() == true ? "" : "." + Item.index;
- }
- Tardis.UsageData.addPageEntry(str);
- }
- function onItemExit()
- {
- if(LastSection != null)
- {
- LastSection = null;
- sectionExit();
- }
- else
- {
- itemLoad();
- }
- }
- function maskShow()
- {
- this.attachMovie("clp_fullscreen_mask","mask",Tardis.depth++);
- eval("interface").disable();
- }
- function maskHide()
- {
- mask.removeMovieClip();
- eval("interface").enable();
- }
- overlay = {};
- overlay.showAdvert = function(file)
- {
- if(this.active == true)
- {
- this.onClosed = function()
- {
- this.showAdvert(this.next_file);
- delete this.onClosed;
- delete this.next_file;
- };
- this.next_file = file;
- this.close();
- }
- this.__type = "advert";
- this.show(file);
- };
- overlay.showPromo = function(file)
- {
- if(this.active == true)
- {
- this.onClosed = function()
- {
- this.showPromo(this.next_file);
- delete this.onClosed;
- delete this.next_file;
- };
- this.next_file = file;
- this.close();
- }
- this.__type = "promo";
- this.show(file);
- };
- overlay.showPanel = function(file, blnAsset)
- {
- if(this.active == true)
- {
- this.onClosed = function()
- {
- this.showPanel(this.next_file);
- delete this.onClosed;
- delete this.next_file;
- };
- this.next_file = file;
- this.close();
- }
- this.__asset = blnAsset != true ? false : true;
- this.__type = "panel";
- this.show(file);
- };
- overlay.showIntro = function(file)
- {
- if(this.active == true)
- {
- this.onClosed = function()
- {
- trace("INTRO CLOSED");
- this.showPanel(this.next_file);
- delete this.onClosed;
- delete this.next_file;
- };
- this.next_file = file;
- this.close();
- }
- this.__type = "intro";
- this.show(file);
- };
- overlay.show = function(file)
- {
- this.active = true;
- if(this.__type == "advert")
- {
- lingo("spriteOverlay.show(\"" + file + "\")");
- }
- else
- {
- this.file = file;
- }
- this.showBuild();
- };
- overlay.loadPanel = function()
- {
- Tardis.createEmptyMovieClip("mc_panel",++Tardis.depth);
- var strFile;
- switch(this.__type)
- {
- case "panel":
- strFile = (!this.__asset ? Tardis.ENGINE_FOLDER : Tardis.ASSETS_FOLDER) + "panels/" + this.file + ".swf";
- break;
- case "promo":
- strFile = this.file;
- break;
- case "intro":
- strFile = Tardis.ASSETS_FOLDER + this.file;
- break;
- default:
- error("overlay : loadPanel : type not recognised : " + this.__type);
- }
- with(Tardis.mc_panel)
- {
- loadMovie(strFile);
- _x = 15;
- _y = 112;
- }
- };
- overlay.showBuild = function()
- {
- lingo("spriteVideo.show(FALSE)");
- lingo("bespoke_show(FALSE)");
- if(this.file === "help")
- {
- header.go(this.file);
- }
- splash.interrupt();
- splash.hide();
- if(ActiveSection == null && intro == null)
- {
- splash.endSoundLoop();
- }
- else if(ActiveSection.sandbox == "true")
- {
- template.exit();
- }
- else
- {
- itemHide();
- }
- eval("interface").disable();
- intro.onTransitionEnd();
- switch(this.__type)
- {
- case "advert":
- if(intro == null)
- {
- closeButton.show("advert");
- }
- lingo("spriteOverlay.buildFinished()");
- break;
- case "promo":
- closeButton.show("promo");
- overlay.loadPanel();
- break;
- default:
- if(intro != null)
- {
- }
- closeButton.show(Tardis.overlay.file);
- overlay.loadPanel();
- }
- };
- overlay.close = function()
- {
- if(this.active != true)
- {
- return undefined;
- }
- if(ActiveSection == null)
- {
- header.clearUp();
- splash.startSoundLoop();
- }
- else if(ActiveSection.sandbox != "true")
- {
- if(ActiveSection == "credits")
- {
- Tardis.mc_credits.startCountdown();
- }
- else
- {
- header.go(ActiveSection.id);
- }
- }
- closeButton.hide();
- makeButtonShield();
- eval("interface").enable();
- bottomNav.enable();
- if(intro == null)
- {
- if(ActiveSection == null)
- {
- splash.show();
- splash.restartSection();
- }
- else
- {
- if(splash.interrupted == true)
- {
- splash.resume();
- }
- else if(ActiveItem == null)
- {
- sectionLoad();
- }
- else
- {
- itemShow();
- }
- splash.endSoundLoop();
- }
- }
- else
- {
- intro._visible = true;
- }
- lingo("bespoke_show(TRUE)");
- lingo("spriteVideo.show(TRUE)");
- if(this.__type == "advert")
- {
- lingo("spriteOverlay.close()");
- }
- else
- {
- mc_panel.unloadMovie();
- delete mc_panel;
- Tardis.footer.buttonReset(this.file);
- }
- delete this.file;
- this.active = false;
- if(ActiveSection.sandbox == "true")
- {
- splashRestart();
- }
- overlay.onClosed();
- };
- bottomNav.onOver = function(strID)
- {
- with(Tardis)
- {
- SFX.play("NavOver");
- if(ActiveSection == null)
- {
- splash.pauseAt(strID);
- }
- }
- };
- bottomNav.onOut = function()
- {
- with(Tardis)
- {
- if(ActiveSection == null)
- {
- splash.resume();
- }
- }
- };
- bottomNav.onUp = function(strID)
- {
- with(Tardis)
- {
- if(splash.onAnimationEnd != null && ActiveSection != null)
- {
- bottomNav.setActive(ActiveSection.id);
- return undefined;
- }
- SFX.play("NavClick");
- var blnAtFirstSplash = ActiveSection == null;
- LastSection = ActiveSection;
- ActiveSection = Tardis.Sections[strID];
- if(blnAtFirstSplash)
- {
- if(PLAY_MODE != "browser")
- {
- splash.onAnimationEnd = function()
- {
- this.endSoundLoop();
- this.onAnimationEnd = null;
- this.clearUp();
- this.blnAtStart = true;
- Tardis.sectionGo();
- };
- splash.resume();
- }
- else
- {
- mc_browser_msg.unloadMovie();
- splash.blnAtStart = true;
- }
- }
- else if(strID != LastSection.id)
- {
- if(LastSection.type != "bespoke")
- {
- LastItem = ActiveItem;
- }
- header.go(strID);
- itemExit();
- }
- else
- {
- if(LastSection.type != "bespoke")
- {
- if(ActiveItem != sideMenu.ItemHome)
- {
- itemGo(sideMenu.ItemHome);
- }
- }
- LastSection = null;
- }
- }
- };
- set("interface",{});
- eval("interface").setEnabled = function(val)
- {
- bottomNav._visible = val;
- if(sideMenu.active)
- {
- sideMenu._visible = val;
- }
- if(adverts.enabled == true)
- {
- !val ? adverts.interrupt() : adverts.resume();
- }
- adverts._visible = val;
- };
- eval("interface").enable = function()
- {
- eval("interface").setEnabled(true);
- };
- eval("interface").disable = function()
- {
- eval("interface").setEnabled(false);
- };
-